<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="com.base.myproject.server.tools.DataSetTool"%>
<%@page import="com.base.myproject.client.jdbc.DataSet"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%
	String excel = request.getParameter("excel");
	
	if (excel != null && !excel.equals("")) {
		response.setHeader("Content-disposition","attachment; filename=bureauTotal.xls");
	}

	String where = request.getParameter("data");
	String sql = "select bcode,bname,upcode,(select name from systeminfo where id=systemid) as depname from " +
	" (select employno as bcode,bcode.bname as bname,upcode,systemid " +
	" from hr_wardrode_bcode,bcode,bcode_job where bcode.bcode=hr_wardrode_bcode.bcode " +
	"and bcode.bcode=bcode_job.bcode "+where+") as a";
	
	System.out.println("sql===" + sql);
	DataSetTool DST = new DataSetTool();
	DataSet result = DST.getDataSet(sql);
%>
</head>
<body>
<table style="border-collapse: collapse" cellspacing="0" cellpadding="0" border="1" width="100%" bordercolordark="#CCCCCC" bordercolorlight="#CCCCCC" style="line-height: 150%;border-color:#000000;"> 
	<tr bgcolor="#e8e8e0" align="center">
		<td>衣柜编号</td><td>雇佣编码</td><td>姓名</td><td>部门</td>
	</tr>
	<%
		for(int i = 0;i < result.getRowCount();i++){
	%>
		<tr>
			<td><%=result.getValue(i,"upcode") %></td>
			<td><%=result.getValue(i,"bcode") %></td>
			<td><%=result.getValue(i,"bname") %></td>
			<td><%=result.getValue(i,"depname") %></td>
		</tr>
	<%
		}
	%>
</table>
</body>
</html>